#!/usr/bin/env node

const http=require('http');

http.createServer((req,res)=>{
  console.log('HTTP request method:',req.method);

  switch(req.method){
    case 'GET':
      res.end(req.method);
      break;
    case 'POST':
      res.end(req.method);
      break;
    case 'PUT':
      res.end(req.method);
      break;
    case 'DELETE':
      res.end(req.method);
      break;

    default:
      res.end('something wrong!');
  }
}).listen(8080);










